package cn.kongwg.juc;

import java.util.Arrays;

/**
 * @author kongwg
 * @create 2021-04-22 15:16
 */
@FunctionalInterface
interface Foo {
    void test(int x, int y);

    default int add(int x, int y) {
        return x + y;
    }

    static int div(int a, int b) {
        return a / b;
    }
}


public class LambdaExpress {

    public static void main(String[] args) {
        Foo foo = (x, y) -> {
            System.out.println(x + y);
        };
        foo.test(1, 1);

        int div = Foo.div(1, 1);
        System.out.println("div = " + div);

        int add = foo.add(1, 1);
        System.out.println("add = " + add);
        System.out.println("args = " + Arrays.deepToString(args));
    }
}
